/* eslint-disable */
import {
  getRoomStudent,
  noGetRoomStudent
} from "../../api/ClassManage/Student"

const state = {
  count: 'Afsfdsd333',
  student: []
}

const mutations = {
  getRoom(state, res) {
    state.student = res
  }
}

const actions = {
  async getAllStudent({
    commit
  }) {
    const {
      data: res
    } = await getRoomStudent()
    const {
      data: res1
    } = await noGetRoomStudent()
    if (res.code !== 1 && res1.code !== 1) {
      Message.error(res.msg)
    }
    commit('getRoom', res.data.concat(res1.data))
  },
  async getRoomStudent({
    commit
  }) {
    const {
      data: res
    } = await getRoomStudent()
    if (res.code !== 1) {
      Message.error(res.msg)
    }
    commit('getRoom', res.data)
  },
  async noGetRoomStudent({
    commit
  }) {
    const {
      data: res
    } = await noGetRoomStudent()
    if (res.code !== 1) {
      Message.error(res.msg)
    }
    commit('getRoom', res.data)
  }
}
const getters = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
